package mongodb.general.operator.rule.mysql.controller;

import lombok.extern.slf4j.Slf4j;
import mongodb.general.operator.rule.mysql.domain.InterfaceRule;
import mongodb.general.operator.rule.mysql.service.InterfaceRuleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author timo 2021/3/4
 */
@RestController
@RequestMapping("interfaceRule")
@Slf4j
public class InterfaceRuleController {

    @Autowired
    private InterfaceRuleService interfaceRuleService;

    @GetMapping("/list")
    public List<InterfaceRule> findAll(){
        return interfaceRuleService.list(null);
    }
    @RequestMapping("/save")
    public Boolean save(@RequestBody InterfaceRule interfaceRule){
        interfaceRuleService.save(interfaceRule);
        return Boolean.TRUE;
    }
}
